package com.example.tangjiangxu.lifecycle.lifecycle;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.example.tangjiangxu.lifecycle.R;

public class SecondActivity extends Activity {
    private final static String TAG = "SecondActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(TAG, "onCreate");
        setContentView(R.layout.activity_second);
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG, "onRestart");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG, "onStart");
    }

    @Override
    protected void onRestoreInstanceState(Bundle bundle) {
        String name = bundle.getString("name");
        Log.i(TAG, "onRestoreInstanceState" + name);
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG, "onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG, "onPause");
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        Log.i(TAG, "onSaveInstanceState");
        bundle.putString("name", "josan");
    }


    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG, "onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy");
    }


}
